package ai

import (
	"context"
	"gitee.com/CrazyMage/blog-service/global"
	"log"

	"github.com/cloudwego/eino-ext/components/model/ollama"
	"github.com/cloudwego/eino/components/model"
)

func CreateOllamaChatModel(ctx context.Context) model.ToolCallingChatModel {
	chatModel, err := ollama.NewChatModel(ctx, &ollama.ChatModelConfig{
		BaseURL: "http://localhost:11434", // Ollama 服务地址
		Model:   "deepseek-r1:7b",
	})

	if err != nil {
		global.Logger.Fatalf(ctx, "create ollama chat model failed: %v", err)
		log.Fatalf("create ollama chat model failed: %v", err)
	}

	return chatModel
}
